# -*- codeing = utf-8 -*-
# @Time: 2023/6/10 11:10
# @Author: caoyi
# @File: index_page.py
# @Software: PyCharm
from selenium.webdriver.common.by import By

from tests.pages.base_page import BasePage
from tests.pages.goods_page import GoodsListPage, GoodsListPage


class IndexPage(BasePage):
    '''
    首页，集成父类BasePage用于复用driver
    '''
    def click_goods_manager_button(self):
        goods_manager = '//span[text()="商品管理"]'
        self.driver.find_element(By.XPATH, goods_manager).click()

    def click_goods_list_button(self):
        #         点击商品列表
        goods_list_button = '//span[text()="商品列表"]'
        self.driver.find_element(By.XPATH, goods_list_button).click()
        # 跳转到商品列表页面
        return GoodsListPage(self.driver)